// router.js
import { createRouter, createWebHistory } from 'vue-router';

// 引入组件
import Home from './components/Home.vue';
import Stock from './components/Stock.vue';

// 定义路由
const routes = [
    { path: '/', component: Home },
    { path: '/stock/:code', component: Stock }
];

// 创建router实例
const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;